package net.sharpf2.api.info;

import net.sharpf2.api.types.Content;
import net.sharpf2.sfcore.client.Interface;

/**
 * Class to handle items.
 * @author Piotr Gajdowski
 */
public class Item {
    private Content<Interface> item;

    public Item(Content<Interface> item) {
        this.item = item;
    }

    /**
     * Returns the item id
     * @return id
     */
    public int getId() {
        return this.item.getContent().getId();
    }

    /**
     * Returns the amount of items in the stack
     * @return amount
     */
    public int getStackSize() {
        return this.item.getContent().getStackSize();
    }

    /**
     * Interact with this item
     * @param action the action to perform
     */
    public void interact(String action) {
        this.item.getActions().click(action);
    }
    
    /**
     * Hover over item
     */    
    public void hover() {
        this.item.getActions().hover();
    }
    
    /**
     * Get the Content (Interface) of the item 
     * @return Interface
     */
    public Interface getContent() {
    	return this.item.getContent();
    }
}
